<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Mashup Services</title>
<link rel="stylesheet" type="text/css" href="jquery/jquery.mobile-1.0a4.1.css" />
<script src="jquery/jquery-1.6.1.min.js"></script>
<script src="jquery/jquery.mobile-1.0a4.1.js"></script>
<script type="text/javascript">
	$('document').ready(function() {
		var keyword = "<?php echo $_GET['keyword']; ?>";
		keyword = encodeURIComponent(keyword);
		console.log("xml_proxy.php?url="+encodeURIComponent("http://apis.daum.net/shopping/search?q="+keyword+"&apikey=714dd7e388225a4430ed1b857a0c3ab58ff7fb49"));
		$.get("xml_proxy.php?url="+encodeURIComponent("http://apis.daum.net/shopping/search?q="+keyword+"&apikey=714dd7e388225a4430ed1b857a0c3ab58ff7fb49"), function(xml) {
			
		//alert(xml);
			$(xml).find('item').each(function() {
				$("#shopping_list").append(
					'<li class="ui-li-has-thumb">'+
						'<a href="'+$(this).find('link').text()+'">'+
						'<img class="ui-li-thumb" src="'+$(this).find('image_url').text()+'" />'+
						'<h3 class="ui-li-heading">'+$(this).find('title').text()+'</h3>'+
						'<p class="ui-li-desc">'+$(this).find('price_min').text()+'원</p>'+
						'</a>'+
					'</li>'
				);
			});
			$('#shopping_list').listview('refresh');
		});
	});
</script>
</head>
<body>
<div data-role="page" data-theme="b">
	<div data-role="header">
		<h1>Shopping List</h1>
	</div>
	<div data-role="content" data-theme="c">
		<ul id="shopping_list" data-role="listview" data-split-icon="gear" data-split-theme="d" data-theme="c">
		</ul>
	</div>
	<div data-role="footer" data-theme="a">
		<div data-role="navbar">
			<ul>
				<li><a href="service_list.html" rel="external" data-icon="grid">Services</a></li>
				<li><a href="preference.html" rel="external" data-icon="gear">Preference</a></li>
			</ul>
		</div>
	</div>
</div>
</body>
</html>